﻿using Clinent.Main.Data;
using GalaSoft.MvvmLight.Messaging;
using HandyControl.Tools.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Clinent.Main.View.MainWindow
{
    /// <summary>
    /// UcCurrentMenuContent.xaml 的交互逻辑
    /// </summary>
    public partial class UcCurrentMenuContent
    {
        private bool _isFull;

        public UcCurrentMenuContent()
        {
            InitializeComponent();


            Messenger.Default.Register<bool>(this, MessengerTokenData.FullSwitch, FullSwitch);
        }

        /// <summary>
        /// 全屏切换
        /// </summary>
        /// <param name="isFull"></param>
        private void FullSwitch(bool isFull)
        {
            if (_isFull == isFull) return;
            _isFull = isFull;
            if (_isFull)
            {
                BorderEffect.Collapse();
                BorderTitle.Collapse();
                gridMain.HorizontalAlignment = HorizontalAlignment.Stretch;
                gridMain.VerticalAlignment = VerticalAlignment.Stretch;
                gridMain.Margin = new Thickness();
                PresenterMain.Margin = new Thickness();
            }
            else
            {
                BorderEffect.Show();
                BorderTitle.Show();
                gridMain.HorizontalAlignment = HorizontalAlignment.Center;
                gridMain.VerticalAlignment = VerticalAlignment.Center;
                gridMain.Margin = new Thickness(16);
                PresenterMain.Margin = new Thickness(0, 0, 0, 10);
            }
        }
    }
}
